﻿using CatUtils.Utils.Currency;
using CatUtils.Utils.Currency.TextUtils;
using System;
using System.Windows.Forms;

namespace RabbitDownload.WebSite.Pixiv.PixivDay
{
    public partial class EveryDayControl : UserControl
    {
        public EveryDayControl()
        {
            InitializeComponent();
            InitView();
        }

        private void InitView()
        {
            comboBox1.SelectedIndex = 0;

            dateTimePicker1.Value = dateTimePicker1.Value.AddDays(-1);
            PixivStaticValue.ExcludeOpenFlag = checkBox3.Checked;
            PixivStaticValue.BlockComic = checkBox1.Checked;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            PixivDayScanner.Start(dateTimePicker1.Text, PixivDayScanner.GetAPI(comboBox1.Text), TextHelper.StringToInt(textBox2.Text), comboBox1.Text);
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            PixivStaticValue.BlockComic = checkBox1.Checked;
        }

        private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
        {
        }

        private void checkBox3_CheckedChanged(object sender, EventArgs e)
        {
            PixivStaticValue.ExcludeOpenFlag = checkBox3.Checked;
        }
    }
}